package core;

public class Trip {

	public static final int REGISTERED = 0;
	public static final int CASUAL = 1;
	public static final int OTHER = 2;
	
	public static final int MALE = 0;
	public static final int FEMALE = 1;
	public static final int NA = 2;
	
	private int id;
	private String startDate;
	private String endDate;
	private int duration;
	private String bikeNumber;
	private int subscriptionType;
	private int birthDate;
	private int gender;
	
	public Trip()
	{
		
	}

	public Trip(int id, String startDate, String endDate, int duration,
			String bikeNumber, int subscriptionType, int birthDate, int gender) {
		super();
		this.id = id;
		this.startDate = startDate;
		this.endDate = endDate;
		this.duration = duration;
		this.bikeNumber = bikeNumber;
		this.subscriptionType = subscriptionType;
		this.birthDate = birthDate;
		this.gender = gender;
	}

	public int getId() {
		return id;
	}

	public String getStartDate() {
		return startDate;
	}

	public String getEndDate() {
		return endDate;
	}

	public int getDuration() {
		return duration;
	}

	public String getBikeNumber() {
		return bikeNumber;
	}

	public int getSubscriptionType() {
		return subscriptionType;
	}

	public int getBirthDate() {
		return birthDate;
	}

	public int getGender() {
		return gender;
	}
	
	public static int getSubscritionTypeFromString(String type)
	{
		if(type.contains("Registered"))
		{
			return REGISTERED;
		}
		else if(type.contains("Casual"))
		{
			return CASUAL;
		}
		else
		{
			return OTHER;
		}
	}
	
	public static int getGenderFromString(String gender)
	{
		if(gender.contains("Male"))
		{
			return MALE;
		}
		else if (gender.contains("Female"))
		{
			return FEMALE;
		}
		else
		{
			return NA;
		}
	}
	
	
	
}
